#pragma once 
#include "ofBaseTypes.h"
#include "ofPixels.h"
#include "libusb.h"
#include "libuvc.h"
#define OF_VIDEO_CAPTURE_UVCSHOW 

class ofxUVCShowGrabber : public ofBaseVideoGrabber
{
	ofxUVCShowGrabber();
	virtual ~ofxUVCShowGrabber();
	vector<ofVideoDevice>	listDevices() const;
	bool					setup(int w, int h);
	void					update();
	bool					isFrameNew() const;
	bool					isInitialized() const;
	bool					setPixelFormat(ofPixelFormat pixelFormat);
	ofPixelFormat			getPixelFormat() const;
	ofPixels&				getPixels();
	const ofPixels&			getPixels() const;
	void					close();
	void					clearMemory();
	void					videoSettings();

	float					getWidth() const;
	float					getHeight() const;
	void					setVerbose(bool bTalkToMe);
	void					setDeviceID(int _deviceID);
	void					setDesiredFrameRate(int framerate);
protected:
	
	bool					bChooseDevice;
	int						deviceID;
	bool 					bVerbose;
	bool 					bGrabberInited;
	ofPixels		 		pixels;
	int						attemptFramerate;
	bool 					bIsFrameNew;

	int						width, height;
	
private:
	uvc_device_t			*m_pUVCDevice;
	uvc_device_handle_t		*m_phdevice;

	typedef struct 
	{
		
	};
};


